import random
series=range(-10,11)
content=''
for i in range(20):
    n=random.choice(series)
    if (i+1)%5 == 0:
        content+=str(n)+'\n'
    else:
        content+=str(n)+'\t'
SSSS=input('输入自己学号后4位：')
f=open(SSSS+'.txt','w')
f.write(content)
f.close()
g=open(SSSS+'.txt','r+')
array=g.read().replace('\t','\n').split('\n')
array.remove('')
positive=0;negative=0;zero=0
for n in array:
    if int(n) > 0:
        positive+=1
    elif int(n) < 0:
        negative+=1
    else:
        zero+=1
g.write('正数个数='+str(positive)+','\
        +'负数个数='+str(negative)+','\
        +'零的个数='+str(zero)+'\n')
g.close()
